<?php

	$xslt_Proc = new XsltProcessor();
    // create a DOM document and load the XSL stylesheet
	$xsl_sheet = new DomDocument();
    // create a DOM document and load the XML data
	$xml_doc = new DomDocument();
  
if (isset($_GET['idC'])){
	$xsl_sheet->load('Competences_Pers.xsl');
	$xslt_Proc->importStylesheet($xsl_sheet);

	$xml_doc->load('personnes.xml');

	$idC=$_GET['idC'];
	$xslt_Proc->setParameter('','idC',$idC);

} else if (isset($_GET['cvFile'])) {
	$xsl_sheet->load('CVetudiants/CV.xsl');
	$xslt_Proc->importStylesheet($xsl_sheet);
	
	$cvFile=$_GET['cvFile'];
	$xml_doc->load('CVetudiants/'.$cvFile);
}
    // transform the XML into HTML using the XSL file
  if ($html = $xslt_Proc->transformToXML($xml_doc)) {
      echo $html;
  } else {
      trigger_error('XSL transformation failed.', E_USER_ERROR);
  } 
?>
